package pl.put.augrelshooter.logic.game.weapon;

public abstract class Weapon {
	protected int ammo;

	public int getAmmo() {
		return ammo;
	}

	/**
	 * Fire with weapon if it is possible.
	 * 
	 * @return true if fire was shoot, false otherwise (there was no ammo).
	 */
	public boolean fire() {
		if (ammo > 0) {
			ammo--;
			return true;
		} else {
			return false;
		}
	}

	public void addAmmo() {
		ammo = Math.min(ammo + getAmmoQuantityInPack(), getMaxAmmo());
	}

	public abstract String getName();

	public abstract int getDamage();

	protected abstract int getMaxAmmo();

	protected abstract int getAmmoQuantityInPack();

	public abstract int getIconIdentifier();
}
